<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>轮播管理</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <link rel="shortcut icon" href="favicon.ico"> <link href="__CSS__/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="__CSS__/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="__CSS__/animate.css" rel="stylesheet">
    <link href="__CSS__/style.css?v=4.1.0" rel="stylesheet">
    <style>
        #file {
            position: relative;
            display: inline-block;
            background: #D0EEFF;
            border: 1px solid #99D3F5;
            border-radius: 4px;
            padding: 4px 12px;
            overflow: hidden;
            color: #1E88C7;
            text-decoration: none;
            text-indent: 0;
            line-height: 20px;
        }
        #file input {
            position: absolute;
            font-size: 100px;
            right: 0;
            top: 0;
            opacity: 0;
        }
        #files {
            position: relative;
            display: inline-block;
            background: #D0EEFF;
            border: 1px solid #99D3F5;
            border-radius: 4px;
            padding: 4px 12px;
            overflow: hidden;
            color: #1E88C7;
            text-decoration: none;
            text-indent: 0;
            line-height: 20px;
        }
        #files input {
            position: absolute;
            font-size: 100px;
            right: 0;
            top: 0;
            opacity: 0;
        }

    </style>
</head>

<body class="gray-bg">
<div><h1>职业路径管理</h1></div>

<div class="row">
    <div class="col-sm-4 col-xs-4 col-sm-offset-4 col-xs-offset-4 center-block ">
        <a  class="btn btn-lg btn-danger "   href='javascript:history.go(-1)'>返回</a>
    </div>
    <div class="center-block col-sm-4 col-xs-4 col-sm-offset-4 col-xs-offset-4 ">
        <a  class="btn btn-lg btn-danger "   href="{:url('Occupation/add_course')}?occupation_title_id={$occupation_title_id}&picture_id={$picture_id}">添加</a>
    </div>
    <table class="table table-hover table-bordered text-center">
        <thead >
        <tr >
            <th class="text-center">id</th>
            <th class="text-center">名字</th>
            <th class="text-center">管理操作</th>
        </tr>
        </thead>
        <tbody>
        {empty name="course"}
        {else/}
        {volist name="course" id="value"}
        <tr>
            <td>{$value.id}</td>
            <td>{$value.record_name}</td>
            <td>
                <button class="btn btn-danger" onclick="deletes('{$occupation_title_id}','{$value.id}')">删除</button>
            </td>
        </tr>
        {/volist}
        {/empty}
        </tbody>
    </table>

</div>
</div>


<!-- 全局js -->
<script src="__JS__/jquery.min.js?v=2.1.4"></script>
<script src="__JS__/bootstrap.min.js?v=3.3.6"></script>
<script src="__JS__/jquery.validate.js"> </script>


<!-- 自定义js -->
<script>
    var update_course="{:url('Occupation/update_course')}";

    function deletes(occupation_title_id,course_id) {
        if(confirm("你确定要删除课程吗  ？！")){
            $.ajax({
                url:update_course,
                type:"post",
                dataType:"text",
                data:{
                    occupation_title_id:occupation_title_id,
                    course_id:course_id
                },
                success:function (data) {
                    if(data=="1"){
                        alert("删除成功")
                        history.go(0)
                    }else{
                        alert("删除失败")
                    }
                },
                error:function (e) {
                    alert(e.response)
                }


            })
        }
    }



</script>







</body>

</html>
